package com.google.code.opengw.http;

public class HTTPHeader {
	private String name;
	private String value;
	
	public HTTPHeader(String name, String value){
		this.name = name;
		this.value = value;
	}
	
	public HTTPHeader(String headerLine){
		String[] arr = headerLine.split(":");
		this.name = (arr[0]).trim();
		this.value = (arr[1]).trim();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	public String toHeaderLine(){
		StringBuilder headerLine = new StringBuilder();
		headerLine.append(name).append(": ").append(value).append("\r\n");
		return headerLine.toString();
	}

	@Override
	public String toString() {
		return "HTTPHeader [name=" + name + ", value=" + value + "]";
	}
	
	
}
